package com.css.apps.base.user.action.report;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.css.apps.base.common.util.ExportExcelUtil;
import com.css.webbase.webwork.action.UserAction;
import com.css.apps.base.user.service.UserCountGraphService;
import com.opensymphony.webwork.ServletActionContext;

@SuppressWarnings("serial")
public class AuthSysUserCountExport extends UserAction {

	@Override
	protected String userGo() {
		HttpServletResponse response = ServletActionContext.getResponse();
		HttpServletRequest request = ServletActionContext.getRequest();
		UserCountGraphService service = new UserCountGraphService();
		
		List<Object[]> list = service.getAuthSysUserCountTabData();
		
		List<String> headList = new ArrayList<String>();
		headList.add("系统名称");
		headList.add("人员数量");
		headList.add("百分比");

		// 0:long 1:字符组 2:日期 3:double 其他:字典
		List<String> typeList = new ArrayList<String>();
		typeList.add("1");
		typeList.add("0");
		typeList.add("3");

		List<Integer> widthList = new ArrayList<Integer>();
		widthList.add(7000);
		widthList.add(4000);
		widthList.add(3000);

		ExportExcelUtil.exportExcel("AuthSysUserCountExport.xls", list, headList, typeList, widthList, request, response);
		return null;
	}

}
